# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Martin Wimpress <code@flexion.org>
# Contributor: Jorge Araya Navarro <elcorreo@deshackra.com>
# Contributor: Piotr Beling <qwak@w8.pl>
# Contributor: Vianney le Clément <vleclement AT gmail · com>

pkgname=unittestpp
pkgver=2.0.0
pkgrel=4
pkgdesc='Lightweight unit testing framework for C++'
url='https://github.com/unittest-cpp/unittest-cpp/'
arch=('loong64' 'x86_64')
license=('MIT')
depends=('gcc-libs')
makedepends=('cmake')
options=('staticlibs')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/unittest-cpp/unittest-cpp/archive/v${pkgver}.tar.gz)
sha256sums=('74852198877dc2fdebdc4e5e9bd074018bf8ee03a13de139bfe41f4585b2f5b9')
sha512sums=('39318f4ed31534c116679a3257bf1438a6c4b3bef1894dfd40aea934950c6c8197af6a7f61539b8e9ddc67327c9388d7e8a6f8a3e0e966ad26c07554e2429cab')

prepare() {
  mkdir -p unittest-cpp-${pkgver}/build
}

build() {
  cd unittest-cpp-${pkgver}/build
  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects"
  make all
}

package() {
  cd unittest-cpp-${pkgver}
  make -C build DESTDIR="${pkgdir}" install
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
